//
//  CMWebJsDelegate.m
//  Live
//
//  Created by pie on 2020/5/16.
//  Copyright © 2020 LaKa. All rights reserved.
//

#import "CMWebJsDelegate.h"

@implementation CMWebJsDelegate

- (instancetype)initWithScriptTarget:(id<WKScriptMessageHandler>)target{
    if(self=[super init]){
        self.target = target;
    }
    return self;
}
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{
    if([self.target respondsToSelector:@selector(userContentController:didReceiveScriptMessage:)]){
        [self.target userContentController:userContentController didReceiveScriptMessage:message];
    }
}


@end
